package com.mdd.admin.validate.course;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;

/**
 * 专栏课程关联参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CourseColumnParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Integer id;

    @NotNull(message = "courseId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "courseId参数值不能少于0", groups = {create.class, update.class})
    private Integer courseId;

    @NotNull(message = "relationId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "relationId参数值不能少于0", groups = {create.class, update.class})
    private Integer relationId;

    @NotNull(message = "feeType参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "feeType参数值不在符合范围", groups = {create.class, update.class})
    private Integer feeType = 1;

//    @NotNull(message = "sort参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
    private Integer sort = 0;

}
